package com.yuanfeng.payment.feign;

import com.yuanfeng.commoms.util.ResponseResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.Map;


@FeignClient(name = "mall-order", url = "http://localhost:8082")
public interface OrderServiceClient {

    /**
     * 查询是否多订单
     *
     * @param map
     * @return
     */
    @PostMapping("/order/base/queryShopIdByOrderIdNum")
     ResponseResult queryShopIdByOrderIdNum(@RequestBody Map<String, Object> map);

    /**
     * 查询店铺信息
     *
     * @param map
     * @return
     */
    @PostMapping("/order/base/queryShopIdByOrderInfo")
    ResponseResult queryShopIdByOrderInfo(@RequestBody Map<String, Object> map);

    /**
     * 查询商品数量 fegin
     *
     * @param map
     * @return
     */
    @PostMapping("/order/base/queryShopIdByOrderIdCount")
    Integer queryGoodNumByOrderId(@RequestBody Map<String, Object> map);

    /**
     * 判断该订单是否是虚拟订单或者是门店自提订单
     */
    @PostMapping("/order/base/isVirtualOrder")
    ResponseResult isVirtualOrder(@RequestBody Map<String, String> orderIdIsNum);

    /**
     * 为虚拟订单添加兑换码
     */
    @PostMapping("/order/base/addRedeemCode")
    ResponseResult addRedeemCode(@RequestBody Map<String, Object> param);

    /**
     * 下单通知
     */
    @RequestMapping("/order/base/orderToInform")
    ResponseResult orderToInform(@RequestBody Map<String, Object> map);

    /**
     * 获取非数字订单
     */
    @PostMapping(value = "/order/base/queryUpayByOrderId")
    String queryUpayByOrderId(@RequestBody String order_id);

    /**
     * 更新orderBase中支付方式等字段
     */
    @RequestMapping("/order/base/updateByPaymentType")
    public ResponseResult UpdateOrderBaseByPayment(@RequestBody Map<String, Object> map);


    /**
     * 根据订单id查订单信息
     *
     * @param OrderId
     * @return
     */
    @GetMapping("/order/base/selectOrderInfoById")
    ResponseResult selectOrderInfoById(@RequestParam("OrderId") String OrderId);

    /**
     * 更新orderBase中支付方式等字段
     *
     * @param map
     * @return
     */
    @PostMapping("/order/base/updateByPaymentTypeFegin")
    boolean HFiveUpdateOrderBaseByPayment(@RequestBody Map<Object, Object> map);
}
